UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+fGYUM2ygwzRdW8wewIrqf/ds08NWMNTAb5UPyDhRvs='
WHERE
key_id = 'f5574928cb0e625ee55267b7a62573883b02147281d6e7c7a1da86b1103e0a6c'
AND (
token = '+fGYUM2ygwzRdW8wewIrqf/ds08NWMNTAb5UPyDhRvs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)