UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0dmqyuAC8rR1vtX+Fjlv6KLuyGd3kAow87Ldoe6p4ac='
WHERE
key_id = 'c20885525796ac32f7bdfd1bf1df3d4973ac85ce0b2b402ef9f18ac6b81e14ca'
AND (
token = '0dmqyuAC8rR1vtX+Fjlv6KLuyGd3kAow87Ldoe6p4ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)