UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'azgg55FvhuVtBfhZvkJnidCRKGr+lynWB65zGnfZ0QE='
WHERE
key_id = '5a68a6dd87c0b3eee0724c55e5ad73e157863eb8a080293b8c1da49f81437b5b'
AND (
token = 'azgg55FvhuVtBfhZvkJnidCRKGr+lynWB65zGnfZ0QE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)