UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5BZRxk/Z0eluu+SciO/He8VQOJM61zXcy3LGgJ9Nz8w='
WHERE
key_id = '718d8818ced4e5108fa5abb946034ca54a4156a9f61259cecf676207e162d5b5'
AND (
token = '5BZRxk/Z0eluu+SciO/He8VQOJM61zXcy3LGgJ9Nz8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)