UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '85ClBLDlLdxzRgznJfP52mehqXK7IZRB8yUO/t5emU0='
WHERE
key_id = 'f1d731652da8e5ad6cec3215e23efae463fe28e5124f6aaffe55493ab93db470'
AND (
token = '85ClBLDlLdxzRgznJfP52mehqXK7IZRB8yUO/t5emU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)