UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dIDs5W9C8L6f8LxATcfLjrFe5RYXL7Kx2rv5tF/yWxs='
WHERE
key_id = '8a0d44ed93a84bd19d0a0f9dcf99a47c4a38d8ad27470a7f63090e2ed4464427'
AND (
token = 'dIDs5W9C8L6f8LxATcfLjrFe5RYXL7Kx2rv5tF/yWxs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)