UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fyPf1jskJud+sW4KVQYpQyefmnpk3Tgz6LgeGbCR6Rw='
WHERE
key_id = '0b328f03b9b7fbfd572e2494a4ba9ba5144f4e502dc287670f2e7f0601deb1ce'
AND (
token = 'fyPf1jskJud+sW4KVQYpQyefmnpk3Tgz6LgeGbCR6Rw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)