UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D1qyWVERqBJuIx0EvxCHDTRJXj3moqNnjt5CJp+VJsA=' 
WHERE 
  key_id = '94475dda0cb45edeb7411cf0f1c5a7a20ced3f857611fc59754aaa76b18ede22' 
  AND (
    token = 'D1qyWVERqBJuIx0EvxCHDTRJXj3moqNnjt5CJp+VJsA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019