UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's9B17yG5hx/INDY2qcEOVKbjSm6AbD77uBotuALEON0='
WHERE
key_id = '87119f6302588c6d09ad868f216e2964599e2f5be0f6739a4e6a5045be7c2d47'
AND (
token = 's9B17yG5hx/INDY2qcEOVKbjSm6AbD77uBotuALEON0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)