UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KLyJHF1Ig69Qfd1cn3qTLGE4hWBL7+T8MwGTzF5jH/U=' 
WHERE 
  key_id = '1cc6b9fe01db39d91f4d681954aeee8007aba45c6c2589be1d44f97169a22784' 
  AND (
    token = 'KLyJHF1Ig69Qfd1cn3qTLGE4hWBL7+T8MwGTzF5jH/U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022