UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lkqTZiY9kvwy26zmvFK0rB/SwtOUyONmPw8fD847eZg='
WHERE
key_id = '28969b992c714a606e0b357646a42e2e3faf894fe05b57f7b09640e3dfdecce6'
AND (
token = 'lkqTZiY9kvwy26zmvFK0rB/SwtOUyONmPw8fD847eZg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)