UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o2ubU89rHVCasD/YdpUWjiR7IBxMHJO1IEyVzhfL/SQ=' 
WHERE 
  key_id = '233dfd6faaddffd4ad8ab4e8b61f5d577de4e7feec0125b6512e7cd310414677' 
  AND (
    token = 'o2ubU89rHVCasD/YdpUWjiR7IBxMHJO1IEyVzhfL/SQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028