UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQ0o3HDbc1zxy1Qy1XBz0pew4GVy8pJLgmMDP8ya3jA='
WHERE
key_id = '39b3944c84f7720af9a261689f9a6f16c7d68fc50bc3ca2a9b60f69c3b4c7a7a'
AND (
token = 'PQ0o3HDbc1zxy1Qy1XBz0pew4GVy8pJLgmMDP8ya3jA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)