UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+/g0aW3KrwI0Pg+PJnWBO5ta3c+6x3DLhuNA9dKbRCQ=' 
WHERE 
  key_id = '8158d94343d5d09d1b11fa105c7eb764d6d38ccaf22e6fdd1d29b645e95fdfec' 
  AND (
    token = '+/g0aW3KrwI0Pg+PJnWBO5ta3c+6x3DLhuNA9dKbRCQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029