UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zoK3tN95RKB8TErKd/4mNtBc1nNnHm4IMI4viVwdTHk='
WHERE
key_id = 'bdccf72e4bdbc1d62cec2f1615aaa4a4c0453ba1829bda5566fd514799521cb8'
AND (
token = 'zoK3tN95RKB8TErKd/4mNtBc1nNnHm4IMI4viVwdTHk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)