UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8xjbevvWHgf0KC0MZ1DHRHlzeOPSgr8bDbCwuIvWb18=' 
WHERE 
  key_id = 'e608494e995a6ca28f06d04e273a84e75e60335444984b2d4cbe45e86cfa08d3' 
  AND (
    token = '8xjbevvWHgf0KC0MZ1DHRHlzeOPSgr8bDbCwuIvWb18=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041