UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qhwtXSHcbGsRYwhShBYmyDrga9fHP7wqQ6Fp5q8qyRo=' 
WHERE 
  key_id = '27fe42d001768ab608af5730c4fbf809a879f09989279fc971ec8694c2517a2d' 
  AND (
    token = 'qhwtXSHcbGsRYwhShBYmyDrga9fHP7wqQ6Fp5q8qyRo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041