UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'elkg4mB6WF4VpfQz1SUyHn01H5rHS00w8n7x5JL/dGc='
WHERE
key_id = 'f15b911e4ca84908564dac7e0f66edf7ab35d740f5368221355584e88a3e3559'
AND (
token = 'elkg4mB6WF4VpfQz1SUyHn01H5rHS00w8n7x5JL/dGc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)