UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm2zno9xX4L29iNpl/NqKFiYJoJ/xkROir34s1FxgPd4=' 
WHERE 
  key_id = '0531940c2b688f89594d4ec0f4e40d8401488a7c177ab25c869085644c8bed91' 
  AND (
    token = 'm2zno9xX4L29iNpl/NqKFiYJoJ/xkROir34s1FxgPd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025