UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2e0IjeM8FXy4L2afqKLRYpdRvRncnFjL7RkKRBbBpg4='
WHERE
key_id = '58031713c4a38be328f31679fa92fd93cc243dafb50a0805d1b5c6f5f4ac2ba6'
AND (
token = '2e0IjeM8FXy4L2afqKLRYpdRvRncnFjL7RkKRBbBpg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)