UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0v/7JURLQH8u9PpTGdjwUk4Jrl27lqFeqU2n48xQljI='
WHERE
key_id = 'b84fdc4a29a6e70ddc6427515886e6467b6c2935cfd8af33e0187d5e6412fc22'
AND (
token = '0v/7JURLQH8u9PpTGdjwUk4Jrl27lqFeqU2n48xQljI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)