UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yEZ/YLGEYbAQIvYKQA3bODPGHRTuVPbMY2oULH9tSxs=' 
WHERE 
  key_id = '9644475880736233bc31d6bf869c83540299be8d9c0464bb45f4b1407746e7df' 
  AND (
    token = 'yEZ/YLGEYbAQIvYKQA3bODPGHRTuVPbMY2oULH9tSxs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042