UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pGUv9IRzHD7DDgYXakcDvpIx9iOX/79sxVfwzKVrlL8='
WHERE
key_id = '55eaad28dfb047ac8957709150c3a64f33844b57e19017a1cad6b28e5877e367'
AND (
token = 'pGUv9IRzHD7DDgYXakcDvpIx9iOX/79sxVfwzKVrlL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)