UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gwKk6qvzp1FLbCwdwjI6ybn36bvE37CCOu3S2p7KCsQ=' 
WHERE 
  key_id = '556092aecdd62ccbd953c04bddd7447eafe64918877a83716833a912922d9575' 
  AND (
    token = 'gwKk6qvzp1FLbCwdwjI6ybn36bvE37CCOu3S2p7KCsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036