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

Query time 0.00029