UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lxY0HK6jLU5FuxQs49zssdsmCF9o46j0Ol86wWHOWd4=' 
WHERE 
  key_id = '5c2480d2dd222ba0580158d572172c447d99e4a6a13d08c931dc0c424fcc3aba' 
  AND (
    token = 'lxY0HK6jLU5FuxQs49zssdsmCF9o46j0Ol86wWHOWd4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048