UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7CSAZK/gOPhSDidsQPScnnQ8HGektjDx2yxYOov3mxw='
WHERE
key_id = '4eb983790ca2894b12fcbec7b07ecea69e0d7db7c3cfbd4ee5b089f3dd8abc31'
AND (
token = '7CSAZK/gOPhSDidsQPScnnQ8HGektjDx2yxYOov3mxw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)