UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zYN+RjmXKfzIvnCEqvRz7VQbFUtVBwmrBPDTIAOtxuE=' 
WHERE 
  key_id = '91fbab8da904a0635f91335f32bc40e1e5c70d4fafcf44292ec93a23db8495a6' 
  AND (
    token = 'zYN+RjmXKfzIvnCEqvRz7VQbFUtVBwmrBPDTIAOtxuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042