UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4hFrJbuOotOre1d2Q1orkiekInCp/zHy+xxD3HUiNQ0='
WHERE
key_id = '38a8eb4118848402447069b7d7315578090ecb02b41cf8226291d73b14b4c830'
AND (
token = '4hFrJbuOotOre1d2Q1orkiekInCp/zHy+xxD3HUiNQ0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)