UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JQI6+k0KjLW96TKo5K8UIN2n1EqqNuV4nf7d1yY1KDM='
WHERE
key_id = 'e97925c60efc6d898f085572c5402c42404f6bb608dc50a2dcc4681435cf965c'
AND (
token = 'JQI6+k0KjLW96TKo5K8UIN2n1EqqNuV4nf7d1yY1KDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)