UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MbtpG2Jp0MMz/6qttPIAVCa+C6nT2Szq/husVf2xnDI=' 
WHERE 
  key_id = '84c0489a19250593360a1cb36c961964e4ea3a54f65b6b989c6c69c738cef051' 
  AND (
    token = 'MbtpG2Jp0MMz/6qttPIAVCa+C6nT2Szq/husVf2xnDI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036