UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IQbCCePKLdgBo6MF6Za+wwPbNvBszkJo494P17f5Tgo='
WHERE
key_id = '107d4c122873dc3953a3f2b339dbe6e7a320d746573dc23504717931e7db83d2'
AND (
token = 'IQbCCePKLdgBo6MF6Za+wwPbNvBszkJo494P17f5Tgo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)