UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dGFmoQg/75woBFUpGws/uTRSjfl5HkoVTvyOxy/qtIw=' 
WHERE 
  key_id = '36c7c1bbbc0e7d6230a6ca783ba6685aca80ebd4670a7e9e70d4c6c3f746d10f' 
  AND (
    token = 'dGFmoQg/75woBFUpGws/uTRSjfl5HkoVTvyOxy/qtIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048