UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OMX0VMh5tPJ/vML3KngocMAr/B8hFWDigo4svAEQxzY=' 
WHERE 
  key_id = 'ac959794ff583680ec778fa9c8a2529a147d6735640959732fcc4b986a5c81bb' 
  AND (
    token = 'OMX0VMh5tPJ/vML3KngocMAr/B8hFWDigo4svAEQxzY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043