UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OpHJrU0/BJtSMUuQ6CvcM4g6o2F4YC6hE3rItsoMQ60=' 
WHERE 
  key_id = 'c4fc9917a337ba71c7c4be61c9de56ffe3a09d92e3b0d93f981afc941226b006' 
  AND (
    token = 'OpHJrU0/BJtSMUuQ6CvcM4g6o2F4YC6hE3rItsoMQ60=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030