UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tnG4LMDjmu2JNg0hEKAHJZv7/qeaD4/H3lZkZQEtvus=' 
WHERE 
  key_id = '035e42bfc170b52fc45f11bb0cf616007516f5cae3b5bb767ced7c16ff4c0e0d' 
  AND (
    token = 'tnG4LMDjmu2JNg0hEKAHJZv7/qeaD4/H3lZkZQEtvus=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034