UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HEGRx91AVrOed3AMLWy+CkaGaUpEIvCaulp75NoVsvE=' 
WHERE 
  key_id = 'aba1938ed66962f222fc5173eb4dab00508dc5224fea98d995a1299cd92b3091' 
  AND (
    token = 'HEGRx91AVrOed3AMLWy+CkaGaUpEIvCaulp75NoVsvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020