UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TaZ4t9BdQC+Indc3wnDyKufb/lTR/Jbu2OQu2ziqBo0=' 
WHERE 
  key_id = 'fd943576093b6c0ad99523a1ce0b269881a6cbeda12bf86f056076541b16c060' 
  AND (
    token = 'TaZ4t9BdQC+Indc3wnDyKufb/lTR/Jbu2OQu2ziqBo0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030