UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RpQMD3Tek1kpWk/8XWdrmc7ZYmQ79M3hN9TVZcFipTA=' 
WHERE 
  key_id = '63fb2a481aef723a7e06af8fc7d0bf3a7c364ae815eb5725a8af6d7943396c1b' 
  AND (
    token = 'RpQMD3Tek1kpWk/8XWdrmc7ZYmQ79M3hN9TVZcFipTA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032