UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qPa4MSnu7ADRLwGYrRykOsfAxFTKuJifipZ/s1viRLI=' 
WHERE 
  key_id = '2d9ff1c0f5a147a73bd9d6570e32bd4debdb169d06589bff4dca17aacc1a9186' 
  AND (
    token = 'qPa4MSnu7ADRLwGYrRykOsfAxFTKuJifipZ/s1viRLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030