UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZkCUIxfJTL5GH37qKQcdDiwLyQU6UVr4Gzvyaq7pxb8='
WHERE
key_id = 'd40dec99843db3ef008d8d8b58a971c545536af697789bf511132b1c69b11798'
AND (
token = 'ZkCUIxfJTL5GH37qKQcdDiwLyQU6UVr4Gzvyaq7pxb8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)