UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3fKJEIGH2uREBjmv24ZSPWQ7UY5iuwyFu1QVypfz4LA=' 
WHERE 
  key_id = '4c9877085ff99ca7a6e3f5e2dd02a77e238ed1ea88a5ed64744dcec3d914134f' 
  AND (
    token = '3fKJEIGH2uREBjmv24ZSPWQ7UY5iuwyFu1QVypfz4LA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043