UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uzrjV/elAR/+eByz2uHMWttGmJHQVx8+a+w5J2VAgyc=' 
WHERE 
  key_id = 'b1b89fae6c9d8d81e486cc24df7af745e5820b71279b9bc0019f0ddd4a121761' 
  AND (
    token = 'uzrjV/elAR/+eByz2uHMWttGmJHQVx8+a+w5J2VAgyc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041